﻿<?php
     session_start();
     include("dbconfig.php");
     $newpass = $_REQUEST['newpass']; 
     $db = mysql_pconnect($dbhost, $dbuser, $dbpassword)or die("Connection Error: " . mysql_error());

     mysql_select_db($database) or die("Error conecting to db.");
      $newpass=md5($newpass);
      $userid=$_SESSION['userid'];
     $sql= "Update userinfo set password = '$newpass' where userid = '$userid'";
      
     $result = mysql_query($sql);
     if (!$result) 
         echo "SQL错误：".mysql_error();
     else 
       echo "密码修改成功,新密码为".$_REQUEST['newpass'];



?>
